import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {HomeComponent} from './home.component';
import {HomeResolverService} from './home-resolve.service';
import {BaseComponent} from './base/base.component';

const routes: Routes = [
  {
    path: '',
    component: HomeComponent,
    resolve: {homeDatas: HomeResolverService},
    children: [
      {path: '', component: BaseComponent},
      {path: 'base', component: BaseComponent},
      // {path: '', pathMatch: 'full', redirectTo: '/home/base'},
      // {path: '**', redirectTo: '/home/base'},
      {path: '**', component: BaseComponent}
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
  providers: [HomeResolverService]
})
export class HomeRoutingModule {
}
